import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/layout/index.vue'
import system from './system'
// 本地 Cookie 存储
// import Cookie from 'js-cookie'
Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login.vue')
  },
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    redirect: '/dashboard',
    children: [
      {
        path: 'dashboard',
        name: 'Dashboard',
        component: () => import('../views/system/home/Dashboard.vue'),
        meta: {
          title: '首页'
        }
      }
    ]
  },
  ...system
]

const router = new VueRouter({
  routes
})

export default router
